package com.qy.util;


import java.util.List;

public class StringUtil {
	
	

	/**
	 * 把参数转换成int型
	 * @param param
	 * @return
	 */
	public static int getParam(String param){
		int reInt = StaticData.no_param;
		if(param!=null&&!param.isEmpty()&&!param.equals("undefined")){
			reInt = Integer.parseInt(param);
		}
		return reInt;
	}
	
	/**
	 * 把list对象转换成   param,param的格式
	 * @param agentIds
	 * @return
	 */
	public static String listToString(List<Integer> agentIds){
		StringBuffer agentId = new StringBuffer();
		for(int i =0;i<agentIds.size();i++){
			agentId.append(agentIds.get(i));
			if(i<agentIds.size()-1){
				agentId.append(",");
			}
		}
		return agentId.toString();
	}
}
